﻿#ifndef DATATYPE_H
#define DATATYPE_H

#include <QObject>
#include <QRegExpValidator>
//公共，类
class WriteData
{
public:
    WriteData(int startAddress,int registerCount,QList<quint16> data);
    quint16 m_StartAddress;
    quint16 m_RegisterCount;
    QList<quint16> m_Data;
};
//Q_DECLARE_METATYPE(WriteData)

struct ModBusRTUResponse {
    quint8 address;
    quint8 functionCode;
    QList<quint16> data;
    quint16 crc;
};

typedef  struct alignas(1) PLCData
{

}PLC_DATA;


enum  ProType
{
    Type_20KW  = 0,
    Type_3KW = 1,
};



class DataType : public QObject
{
    Q_OBJECT
public:
    explicit DataType(QObject *parent = nullptr);

signals:

};

class IPAddressValidator : public QRegExpValidator
{
public:
    IPAddressValidator(QObject *parent = nullptr);
    State validate(QString &input, int &pos) const override;
};


#endif // DATATYPE_H
